package study.springcloud.client.feign.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.eggs.result.Result;
import study.eggs.result.Results;
import study.springcloud.client.feign.client.PythonClient;

@Slf4j
@RestController
public class PythonController {

    @Autowired
    private PythonClient pythonClient;

    @RequestMapping("/python/sayHi")
    public Result sayHi() {
        Result result = pythonClient.sayHi("zhangsan");
        log.info(">>>>>> {}", result);
        return Results.ok();
    }

    @RequestMapping("/python/sayBye")
    public Result sayBye() {
        Result result = pythonClient.sayBye("10009");
        log.info(">>>>>> {}", result);
        return Results.ok();
    }
}
